package org.huhuiyu.easyui.enity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name = "employee")
public class EmployeeModel implements java.io.Serializable {
	private static final long serialVersionUID = -5137919607908292431L;
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name = "empId")
	private java.lang.Integer empId;
	@Column(name = "empName", nullable = true, length = 50)
	private java.lang.String empName;
	@Column(name = "info", nullable = true, length = 500)
	private java.lang.String info;
	@ManyToOne(fetch = FetchType.EAGER, optional = false)
	@JoinColumn(name = "deptId")
	private DeptModel deptModel;

	public EmployeeModel() {
	}

	public EmployeeModel(java.lang.Integer empId, java.lang.String empName,
			java.lang.String info) {
		this.empId = empId;
		this.empName = empName;
		this.info = info;
	}

	public void setEmpId(java.lang.Integer empId) {
		this.empId = empId;
	}

	public java.lang.Integer getEmpId() {
		return empId;
	}

	public void setEmpName(java.lang.String empName) {
		this.empName = empName;
	}

	public java.lang.String getEmpName() {
		return empName;
	}

	public void setInfo(java.lang.String info) {
		this.info = info;
	}

	public java.lang.String getInfo() {
		return info;
	}

	public DeptModel getDeptModel() {
		return deptModel;
	}

	public void setDeptModel(DeptModel deptModel) {
		this.deptModel = deptModel;
	}

	@Override
	public String toString() {
		return String.format("empId:%s,empName:%s,info:%s,deptModel:%s", empId,
				empName, info, deptModel);
	}
}
